Why Use JavaScript ?JavaScript has a number of uses, from simply adding a little 'flair' and 'style' to your pages (rollovers, banners, scrolling text) to providing functional 'programs' such as checking that a form is filled out correctly.(NOTE : The above links shown in yellow will take you to the example page, where a relevant example will be shown.) JavaScript can be used when ordinary HTML scripting cannot provide the necessary 'effect'. For example, say we wanted to change the appearance of words or graphics when a user points the cursor at them (a rollover), HTML has no way of enabling this effect. From a more 'functional' perspective, say we provided a form on our page where a user could submit details to order a catalogue. With HTML we can present a form to the user, but cannot 'verify' this form. This means that no matter how erroneous the information provided, the form will be sent. JavaScript can be used to check the data entered and ensure that it is in the correct format, e.g that the postcode is a valid one etc. If you're really adventurous, you could provide a program to perform some sort of calculation for the users. For example, an order form could be provided which could total up the cost of the order, work out the tax and convert the cost price to the cuctomer's home currency !!!! |
<< BACK | - HOME - | - RESOURCES - | NEXT >> |